package com.qxkj.youjian.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("SimpleSender")
public class SimpleSender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @GetMapping("simple")
    public void simpleSend(String content){
        log.info("简单队列发送消息：{}",content);
        this.amqpTemplate.convertAndSend("simple",content);

    }

}